/**
 * LGPL
 * @Author jw12
 */
package uk.ac.sanger.solr;

import java.io.PrintWriter;

/**
 * 
 * LPGL
 *@author JWarren
 *
 */
public class CreateSolrIndexerUtil {

	private String nl;
	public CreateSolrIndexerUtil(){
		nl=System.getProperty("line.separator");
	}
	protected void createField(PrintWriter out, String name, String content){
		//only print if the content is not null
		if(content!=null && !content.equals("")){
                    content=content.replace("<a href", "");
                    content=content.replace("</a>", "");
                    content=content.replace(">","");
		String line="<field name=\""+name+"\">"+content+"</field>"+nl;
		line=line.replace("&", "");
		//System.out.println(".");
		out.write(line);
		}
	}
	/**
	 * @return
	 */
	public String getLineSeperator() {
		return nl;
	}
}
